//---------------------------------------------------------------------------

#ifndef uRtfH
#define uRtfH
//---------------------------------------------------------------------------
    #include "uDessin.h"
    #include "ReOLECb.h"
    #include "docobj.h"
//---------------------------------------------------------------------------
#define DebutTexteRTF "{\\rtf"
    class ETATAPI CRtf
    {
        private :
            HMODULE                 m_hRichEditdll;
            CRichEditOleCallback   *m_pRECallback;
            HANDLE                  m_hPere;
          //Caracs du composant en mémoire
            HANDLE                  m_hRchEdt;
            AnsiString              m_Texte;
            TCoorRect               m_Rc;
            Text_Presentation       m_Presentation;
            long                    m_FirstCharPrint;
            EICFont                 *m_Font;

            TCoordonnee __fastcall GetHauteur( );
        public :
            __fastcall CRtf( );
            virtual __fastcall ~CRtf( );
            void __fastcall SupprimeCharacteres( int Begin, int End);
            void __fastcall SuppressionLignesVideALaFin();
            WNDPROC         AncPapaWndProc;
            TCoordonnee     HauteurVoulueParRichEdit;
            void        __fastcall Init();

            void __fastcall InitContenu( const TCoorRect &Rc, const EICFont *Font, const AnsiString& Texte, Text_Presentation Presentation, long FirstCharPrint);
            void __fastcall Draw( TObject *Support, const TCoorRect &Rc, long &nCharFin);
            __property TCoordonnee Hauteur ={read=GetHauteur};
            __property HWND        hRchEdt = {read=m_hRchEdt};
    };


//---------------------------------------------------------------------------
#define DebutTexteOLE "{\\ole"
class COle
{
    private :
        IStorage        *m_pStg;
    	IOleObject      *m_pOleObject;
        IViewObject     *m_pViewObj;
        IViewObject2    *m_pViewObj2;
        IDataObject     *m_pDataObj;
        IRunnableObject *m_pRunObj;
        FORMATETC        m_FormatEtc;
        STGMEDIUM        m_Medium;

        TCoorPoint       m_Size;
        AnsiString       m_File;
        bool             m_bInitialise,m_bResize;

        AnsiString __fastcall GetAppName();

      	static short           nbInstances;
      	static DVTARGETDEVICE  *ms_ptd;
        static DVTARGETDEVICE* __fastcall COle::InitTargetDevice();
        AnsiString aFichierGenere;

    public :
        __fastcall COle( const COle *Ole);
        __fastcall COle( const AnsiString &OLEFile);
        virtual __fastcall ~COle( );
        void __fastcall Draw( TObject *Support, const TCoorRect &Rc, const TCoordonnee &LargeurEtat, bool bOnEstEnHautDeLaPage, long &NumPage);

        TCoordonnee __fastcall GetHauteur( const TCoorPoint &TailleFeuille, bool bOnEstEnHautDeLaPage, long NumPage);
        __property bool Initialise = {read= m_bInitialise};
        __property bool Resize = {read= m_bResize, write= m_bResize};
        __property TCoordonnee Hauteur = {read= m_Size.x};
};


//---------------------------------------------------------------------------
#endif
